<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/15
 * Time: 23:07
 */
header('Content-Type:application/json');
include '../classes/logincheck.php';
include '../classes/conn.php';
$class=$_POST['class'];
if(islogin()=='teacher_login') {
    $query="select * from homework where class='{$class}'";
    $res=mysql_query($query);
    $homeworks=array();
    while ($row=mysql_fetch_assoc($res)){
        $homeworks[]=$row;
    }
    $data=json_encode($homeworks);
    echo $data;
}
